﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using GtsServer.DAL;
using GtsServer.Model;
using System.Data;
using GtsServer.Common;

namespace GtsServer.Manage.Controller
{
    public class szfOrderManageCotroller
    {
        OrderSZFDetailDAL dal = new OrderSZFDetailDAL();
        public List<OrderSZFDetailMouldShow> GetListBysysAccount(int pageIndex, int pageSize, out int count, int id, string sysAccount)
        {
            List<OrderSZFDetailMouldShow> list = new List<OrderSZFDetailMouldShow>();
            DataSet ds = new DataSet();
            string strWhere = string.Empty;
            if (!string.IsNullOrEmpty(sysAccount))
                strWhere = "u.UserAccount='" + sysAccount + "' and odt.ChargeMode =2 and pt.ID=" + id;
            else
                strWhere = " odt.ChargeMode =2 and pt.ID=" + id;

            ds = dal.GetList(pageIndex, pageSize,strWhere);
            count = Convert.ToInt32(ds.Tables[1].Rows[0][0]);
            list = IListDataSet.DataSetToIList<OrderSZFDetailMouldShow>(ds, 0).ToList();
            return list;
        }
    }
}
